﻿using System;
using System.Collections.Generic;
using System.Text;

namespace YouHP.Utility
{
    public class ModuleCtrl
    {
        public static string HeaderFormat1;
        public static string HeaderFormat2;
        public static string HeaderFormat3;
        public static string HeaderFormat4;
        public static string HeaderFormat5;
        public static string HeaderFormat6;
        public static string HeaderFormat7;
        public static string HeaderFormat8;
        public static string HeaderFormat9;
        public static string HeaderFormat10;
        public static string HeaderFormat11;
        public static string FooterFormat;
        public static string FooterFormat2;
        static ModuleCtrl()
        {
            

                        // 可折叠 预先展开
                        HeaderFormat6 = "<div id=\"{0}\" class=\"module\">\r\n"
                        +"<div id=\"{0}_top\" class=\"corners crnr-cobalt\">\r\n"
                        + "<div class=\"cornert\"><div></div></div>\r\n"
                        + "<a id=\"{0}_link\" class=\"collapsed\" onclick=\"ModuleToggleCollapse1(\'{0}\'); return false;\" href=\"#\">\r\n"
                        + "<strong>{1}</strong></a>\r\n"
                  
                        + "</div>\r\n"
                        + "<div id=\"{0}_mid\" class=\"mid\">\r\n"
                        +" <div class=\"m_l\"> \r\n "
                        + " <div class=\"m_r\" id=\"{0}_content\" > \r\n ";

                        // 可折叠 预先折叠
                        HeaderFormat7 = "<div id=\"{0}\" class=\"module\">\r\n"
                        + "<div id=\"{0}_top\" class=\"corners crnr-cobalt\">\r\n"
                        + "<div class=\"cornert\"><div></div></div>\r\n"
                        + "<a id=\"{0}_link\" class=\"collapsed\" onclick=\"ModuleToggleCollapse1(\'{0}\'); return false;\" href=\"#\">\r\n"
                        + "<strong>{1}</strong></a>\r\n"

                        + "</div>\r\n"
                        + "<div id=\"{0}_mid\" class=\"mid\" style=\"display:none\">\r\n"
                        + " <div class=\"m_l\"> \r\n "
                        + " <div class=\"m_r\" id=\"{0}_content\" > \r\n ";

                        // 不可折叠
                        HeaderFormat8 = "<div id=\"{0}\" class=\"module\">\r\n"
                        + "<div id=\"{0}_top\" class=\"corners crnr-cobalt\">\r\n"
                        + "<div class=\"cornert\"><div></div></div>\r\n"
                        + "<strong>{1}</strong>\r\n"

                        + "</div>\r\n"
                        + "<div id=\"{0}_mid\" class=\"mid\">\r\n"
                        + " <div class=\"m_l\"> \r\n "
                        + " <div class=\"m_r\" id=\"{0}_content\" > \r\n ";


                        //可折叠 预先折叠 触发其他模块
                        HeaderFormat9 = "<div id=\"{0}\" class=\"module\">\r\n"
                        + "<div id=\"{0}_top\" class=\"corners crnr-cobalt\">\r\n"
                        + "<div class=\"cornert\"><div></div></div>\r\n"
                        + "<a id=\"{0}_link\" class=\"collapsed\" onclick=\"ModuleToggleCollapse1(\'{0}\');CloseOtherMoudle(\'{0}\'); return false;\" href=\"#\">\r\n"
                        + "<strong>{1}</strong></a>\r\n"

                        + "</div>\r\n"
                        + "<div id=\"{0}_mid\" class=\"mid\" style=\"display:none\">\r\n"
                        + " <div class=\"m_l\"> \r\n "
                        + " <div class=\"m_r\" id=\"{0}_content\" > \r\n ";



                        // 标题链接
                        HeaderFormat10 = "<div id=\"{0}\" class=\"module\">\r\n"
                        + "<div id=\"{0}_top\" class=\"corners crnr-cobalt\">\r\n"
                        + "<div class=\"cornert\"><div></div></div>\r\n"
                        + "<a href=\"{2}\" target=\"_blank\"><strong>{1}</strong></a>\r\n"

                        + "</div>\r\n"
                        + "<div id=\"{0}_mid\" class=\"mid\">\r\n"
                        + " <div class=\"m_l\"> \r\n "
                        + " <div class=\"m_r\" id=\"{0}_content\" > \r\n ";



                        //右边加链接
                        HeaderFormat11 = "<div id=\"{0}\" class=\"module\">\r\n"
                        + "<div id=\"{0}_top\" class=\"corners crnr-cobalt\">\r\n"
                        + "<div class=\"cornert\"><div></div></div>\r\n"
                        + "<strong>{1}</strong><div class=\"rightlink\"><a href=\"{2}\"><span>{3}</span></a></div>\r\n"

                        + "</div>\r\n"
                        + "<div id=\"{0}_mid\" class=\"mid\">\r\n"
                        + " <div class=\"m_l\"> \r\n "
                        + " <div class=\"m_r\" id=\"{0}_content\" > \r\n ";




             FooterFormat ="</div>   \r\n "
                 + "</div>   \r\n "
                 + "</div>   \r\n "
                 + "<div id=\"{0}_bottom\" class=\"bottom\"> "
                 + "<div class=\"b_l\"></div> "
                 + "<div class=\"b_r\"></div> "
                 + "</div> \r\n "
                 + "</div>	\r\n";

           
        }




        //Header4  Footer
        public static string Header4(string moduleId, string caption, bool canCollapse, bool collapsed)
        {
            if(canCollapse == false)
            return string.Format(HeaderFormat8, moduleId, caption);

            if (collapsed)
            return string.Format(HeaderFormat7, moduleId, caption);

            return string.Format(HeaderFormat6, moduleId, caption);
        }
        //触发其他模块函数
        public static string Header5(string moduleId, string caption, bool canCollapse, bool collapsed)
        {
            if (canCollapse == false)
                return string.Format(HeaderFormat8, moduleId, caption);

            if (collapsed)
                return string.Format(HeaderFormat9, moduleId, caption);

            return string.Format(HeaderFormat6, moduleId, caption);
        }

        //标题链接
        public static string Header6(string moduleId, string caption, string href)
        {
            return string.Format(HeaderFormat10, moduleId, caption, href);
        }

        //右边加链接
        public static string Header7(string moduleId, string caption,string href,string link)
        {
            return string.Format(HeaderFormat11,moduleId,caption,href,link);
        }

        public static string Footer(string moduleId)
        {
            return string.Format(FooterFormat, moduleId);
        }



       
    }
}
